package ch.supsi;

import java.io.IOException;

import ch.admin.WebAdminPage;
import ch.connection.SMTP;
import ch.connection.POP;
import ch.connection.SSL;
import ch.connection.ServerEcho;


public class MailServer {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ServerEcho echo = new ServerEcho();
		WebAdminPage webadmin = new WebAdminPage();

		SSL ssl = new SSL();
		ssl.register( "/echo", echo );
		ssl.register( "/webadmin", webadmin );
		ssl.start();

		SMTP smtp = new SMTP();
		smtp.start();
		
		POP pop = new POP();
		// pop.register( "/echo", echo );
		pop.start();

		try{
			Thread.sleep( 2000 );
		} catch(InterruptedException ie){}

		System.out.println ("MailServer started press ENTER to stop");
		try {
			System.in.read();
		} catch ( IOException e ) {}

		System.out.println("MailServer ended");
		System.exit( 0 );
	}
}
